﻿using System;
using Peresvet.Common.Constants;
using Peresvet.Common.Constants.Text;

namespace Peresvet.Models
{
	public class NewsItemModel
	{
		#region Variables

		private string _header;
		private string _description;

		#endregion

		#region Properties

		public int NewsId { get; set; }

		public string ShortHeader
		{
			get
			{
				return _header;
				//return _header.Length > ApplicationSettings.HEADER_NEWS_TEXT_LENGTH
				//	? string.Concat(_header.Substring(0, ApplicationSettings.HEADER_NEWS_TEXT_LENGTH), Symbols.ELLIPSIS)
				//	: _header;
			}
		}

		public string ShortDescription
		{
			get
			{
				return _description.Length > ApplicationSettings.DESCRIPTION_NEWS_TEXT_LENGTH
					? string.Concat(_description.Substring(0, ApplicationSettings.DESCRIPTION_NEWS_TEXT_LENGTH), Symbols.ELLIPSIS)
					: _description;
			}
		}

		public string Header
		{
			get { return _header; }
			set { _header = value ?? string.Empty; }
		}

		public string Description
		{
			get { return _description; }
			set { _description = value ?? string.Empty; }
		}

		public DateTime Date { get; set; }

		public int GalleryId { get; set; }

		public string ImageUrl { get; set; }

		public string ThumbImageUrl { get; set; }

		#endregion
	}
}